package com.gitee.wsl.service.task.state

/**
 * @author: opensnail
 * @date : 2023-09-26 14:26
 * @since : 2.4.0
 */
enum class TaskBatchStatus(val status: Int = 0) {
    /**
     * 待处理
     */
    WAITING(1),

    /**
     * 运行中
     */
    RUNNING(2),

    /**
     * 处理成功
     */
    SUCCESS(3),

    /**
     * 处理失败
     */
    FAIL(4),

    /**
     * 任务停止
     */
    STOP(5),

    /**
     * 取消
     */
    CANCEL(6),
    ;

    companion object {
        val NOT_COMPLETE: List<Int> = listOf(WAITING.status, RUNNING.status)

        val COMPLETED: List<Int> = listOf(SUCCESS.status, FAIL.status, STOP.status, CANCEL.status)

        val NOT_SUCCESS: List<Int> = listOf(FAIL.status, STOP.status, CANCEL.status)
    }
}